package com.sh.sales.happysales.datautils;

import com.sh.polymedicine.happysale.result.UserInfoResult;

import org.litepal.crud.DataSupport;

import java.util.List;

/**
 * Created by zhouyucheng on 2017/9/20.
 */

public class LocalUserInfoUtils {
    public static  boolean insertUserInfoResult(UserInfoResult mUserInfoResult)   {

      return  mUserInfoResult.save();
//        try {
//            mUserInfoResult.saveThrows();
//        }catch (Exception e){
//            e.printStackTrace();
//        }

    }

    public static int deleteUserInfoResult(String infoId) {
        return DataSupport.deleteAll(UserInfoResult.class, "infoId = ? ", infoId + "");
    }

    public static int updataUserInfoResult(UserInfoResult mUserInfoResult, String infoId) {
        return mUserInfoResult.updateAll("infoId=? ", infoId + "");
    }

    public static UserInfoResult queryFirst() {
        return  DataSupport.findFirst(UserInfoResult.class);
    }

    public static List<UserInfoResult> queryALL() {
        return  DataSupport.findAll(UserInfoResult.class);
    }
}
